<?php
/**
* Sets the date range in which to look for transactions, this is done to avoid loading ALL transactions at once.
* (The application currently support last 3 months, 9 or 12 months)
*
* @author       Fabrice Douteaud <clearbudget@douteaud.com>
* @package      actions
* @access       public
*/

/***********************************************************************

  Copyright (C) 2008  Fabrice douteaud (clearbudget@douteaud.com)

    This file is part of ClearBudget.

    ClearBudget is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ClearBudget is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ClearBudget.  If not, see <http://www.gnu.org/licenses/>.


************************************************************************/

// get the requested range
isset($_GET['range'])?$range = $_GET['range']:$range = DEFAULTMONTHRANGE;

// get the limit month from the range
$report = class_report::getInstance();
$limitMonth = $report->getlimitMonth($range);
// set the cookie
setcookie("limitMonth", $limitMonth);
// set the context
class_context::$limitMonth=$limitMonth;
// set the report object
$report->setLimitMonth($limitMonth);


$backAction = $_GET['backAction'];
// fallback in case we do not have a backAction set
if($backAction == '') $backAction = 'tableOverview';

// next is to go to the previous action
class_context::$nextAction = $backAction;
class_context::$snippet = $backAction;
?>